<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" lang="en">

<!--<html xmlns:th="http://www.w3.org/1999/xhtml" lang="en">-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>惠来仙庵数字乡村综合信息服务平台-后台管理系统</title>
    <!-- 引入bootstrap样式 -->
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet" type="text/css">
    <!--图标库-->
    <link th:href="@{/lyear/css/materialdesignicons.min.css}" rel="stylesheet" type="text/css"/>
    <!--自定义样式-->
    <link href="../lyear/css/style.min.css" th:href="@{/lyear/css/style.min.css}" rel="stylesheet" type="text/css"/>

    <style>
        .lear-wrapper {
            position: relative;
        }
        .lear-login {
            display: flex !important;
            min-height: 100vh;
            align-items: center !important;
            justify-content: center !important;
        }
        .login-center1 {
            background: #fff;
            min-width: 38.25rem;
            padding: 2.14286em 3.57143em;
            border-radius: 5px;
            margin: 2.85714em 0;
        }
        .login-header {
            margin-bottom: 1.5rem !important;
        }
        .login-center .has-feedback.feedback-left .form-control {
            padding-left: 38px;
            padding-right: 12px;
        }
        .login-center .has-feedback.feedback-left .form-control-feedback {
            left: 0;
            right: auto;
            width: 38px;
            height: 38px;
            line-height: 38px;
            z-index: 4;
            color: #dcdcdc;
        }
        .login-center .has-feedback.feedback-left.row .form-control-feedback {
            left: 15px;
        }
    </style>
</head>
<body>
<div class="row lear-wrapper">
    <div class="lear-login">
        <div class="login-center1">
            <div class="login-header text-center">
                <h1>后台管理系统</h1>
            </div>
            <form method="post" id="form-submit" name="form-submit">
                <div class="form-group has-feedback feedback-left">
                    <input type="text" placeholder="请输入您的用户名" class="form-control"
                           name="username" id="username"/><span class="help-block"></span>
                    <span class="mdi mdi-account form-control-feedback"
                          aria-hidden="true"></span>
                </div>
                <div class="form-group has-feedback feedback-left">
                    <input type="password" placeholder="请输入密码" class="form-control"
                           id="password" name="password"/><span class="help-block"></span>
                    <span class="mdi mdi-lock form-control-feedback"
                          aria-hidden="true"></span>
                </div>

<!--                <div id="captcha_note_parent"-->
<!--                     class="form-group has-feedback feedback-left row">-->
<!--                    <div class="col-xs-7">-->
<!--                        <input type="text" id="captcha" name="captcha"-->
<!--                               class="form-control" placeholder="请输入验证码">-->
<!--                    </div>-->
<!--                    <div class="col-xs-5">-->
<!--                        <canvas id="canvas" width="120" height="45"></canvas>-->
<!--                    </div>-->
<!--                    <span id="captcha_note_child" class="help-block"-->
<!--                          style="margin-left: 15px"></span>-->
<!--                </div>-->

                <div class="form-group">
                    <button id="login_btn" class="btn btn-block btn-primary"
                            type="button" onclick="saveForm()">立即登录
                    </button>
                </div>
            </form>
<!--            <div style="margin-left: 100px">-->
<!--                <a th:href="@{/toregister.html}">还没有账号？去注册</a>-->
<!--            </div>-->

        </div>
    </div>
</div>
<!-- 引入jQuery和bootstrap的js -->
<script th:src="@{/js2/jquery.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.js}"></script>
<script th:src="@{/js2/md5.js}"></script>
<!-- 点线粒子插件 -->
<script color="255,0,255" opacity='0.8'
        zIndex="9999" count="99"
        src="/js/canvas-nest.js" th:src="@{/js2/canvas-nest.js}"></script>
<script th:inline="javascript">

    function saveForm() {
        $.ajax({
            url: '/platform/system/login',
            data: $("#form-submit").serialize(),
            type: 'post',
            dataType: 'json',
            success: function (result) {
                if (result.code == 200) {
                    window.location.href = "/platform/system/user/toUserinfoListUI";
                }else {
                    alert(result.message);
                }
            }
        })
    }



</script>
</body>
</html>